1 Robot Operating System (ROS 2) - Installation
| Feature / Criteria | VirtualBox | Dual Boot (Ubuntu + Windows) | WSL (Windows Subsystem for Linux 2) |
|---|---|---|---|
| Performance | Moderate (virtualization overhead, slower graphics & I/O) | High (runs directly on hardware, best performance) | High for CPU-bound tasks; GPU support improving but still limited compared to native Linux |
| Ease of Setup | Moderate (need VirtualBox, ISO, setup guest additions) | Complex (partitioning, bootloader setup, risk of mistakes) | Easy (install via Microsoft Store, enable WSL2, install Ubuntu/Debian) |
| Resource Usage | High (VM needs dedicated RAM, CPU, disk space) | Efficient (uses hardware directly) | Low/Moderate (shares Windows resources, no full duplication of OS) |
| Hardware Access (GPU, USB, Sensors, Cameras, etc.) | Limited (USB pass-through possible, GPU support weak) | Full (direct access to all hardware) | Limited but improving (CUDA, DirectML, OpenGL supported in WSLg; hardware drivers not always stable) |
| Networking | NAT/Bridged (sometimes config needed for ROS multi-machine setups) | Native (no issues) | Works with localhost, some complexity in ROS multi-machine networking |
| ROS 2 Compatibility | Good (Ubuntu VM runs ROS 2 natively) | Excellent (native Ubuntu environment) | Good (ROS 2 runs, GUI via WSLg, but some packages requiring real-time hardware drivers may fail) |
| GUI / RViz / Gazebo | Works but slow (requires 3D acceleration support, may lag) | Excellent (native GPU acceleration) | Works with WSLg (much better now, but may lag for heavy 3D sim like Gazebo) |
| Maintenance & Updates | Easy to reset VM snapshots, isolated environment | More effort (dual OS updates, potential bootloader issues) | Easy (managed as Windows app, update via apt + Windows Store) |
| Best Use Case | Beginners, testing ROS 2 without touching main OS | Developers needing max performance, hardware integration, robotics projects | Windows users who want ROS 2 for learning, coding, and light simulation without leaving Windows |
****It is strongly recommended to use a dual-boot setup; however, please be aware of the risks and make sure to back up your entire hard drive beforehand!!!
Kindly download these files:
(1) VBox -https://www.virtualbox.org/wiki/Downloads ;
(2) Ubuntu 22.04 LTS (Jammy Jellyfish)- (4 GB) https://releases.ubuntu.com/jammy/ubuntu-22.04.5-desktop-amd64.iso
Step 1
Step 2 **make sure uncheck "Skip Unattended Installation"
sudo apt update && sudo apt upgrade
sudo apt update && sudo apt install locales -y
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
sudo apt install software-properties-common -y
sudo add-apt-repository universe
sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" \
| sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
echo '# ROS 2 setup' >> ~/.bashrc
echo 'export ROS_DISTRO=humble' >> ~/.bashrc
source ~/.bashrc
sudo apt install ros-$ROS_DISTRO-desktop python3-argcomplete -y
sudo apt install ros-dev-tools -y
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc
echo "alias eb='nano ~/.bashrc'" >> ~/.bashrc
echo "alias sb='source ~/.bashrc'" >> ~/.bashrc
echo "alias gs='git status'" >> ~/.bashrc
echo "alias gp='git pull'" >> ~/.bashrc
echo "alias cw='cd ~/catkin_ws'" >> ~/.bashrc
echo "alias cs='cd ~/catkin_ws/src'" >> ~/.bashrc
echo "alias cm='cd ~/catkin_ws && catkin_make'" >> ~/.bashrc
source ~/.bashrc
rosversion –d
printenv | grep -i ROS
ros2 run demo_nodes_cpp talker
ros2 run demo_nodes_py listener